﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace AoCchatUI
{
    public partial class ChildDebugForm : Form
    {
        ParentForm theParent;
        private TextBoxWriter _sw;

        public ChildDebugForm()
        {
            InitializeComponent();
        }

        private void ChildDebugForm_Load(object sender, EventArgs e)
        {            
            _sw = new TextBoxWriter(richTextBox1);
            Trace.Listeners.Add(new TextWriterTraceListener(_sw));            
        }

        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {
            // Tails the text
            richTextBox1.SelectionStart = richTextBox1.Text.Length;
            richTextBox1.ScrollToCaret();
            richTextBox1.Refresh();
        }
    }
}
